<template>
  <div class="page-common">
    <!--利用mui中的图文表格组件实现：
      http://www.dcloud.io/hellomui/examples/slider-table-default.html
      -->
    <div id="mui-content" class="mui-content" style="background-color:#fff">
      <ul class="mui-table-view mui-grid-view">

        <li class="mui-table-view-cell mui-media mui-col-xs-6" v-for="item in goodlist" :key="item.id">
          <router-link v-bind="{to:'/good/goodinfo/' + item.productId}">
            <img class="mui-media-object" :src="item.imageUrl" alt="item.title">
            <div class="mui-media-body">{{item.title}}</div>

            <div class="desc">
              <p>
                <span>￥{{item.price}}</span>
              </p>
            </div>

          </router-link>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  import { Toast } from 'mint-ui';
  export default{
    data(){
        return{
          goodlist:[], //数据列表
        }
    },
    methods:{
        getlistdata(){
          let that = this;
          that.axios.get("../static/getgoodlist.json", {}).then(function (res){
                that.goodlist = res.data.data.productList[0].item;
//            console.log(that.goodlist);
          });
        }
    },
    created(){
      this.getlistdata();
    }
  }

</script>

<style scoped>
  .mui-content{
    margin:70px 10px;
  }
  #mui-content li{
    border: 1px solid rgba(0,0,0,0.4);
    -webkit-box-shadow: 0 0 1px #c1c1c1;
    -moz-box-shadow: 0 0 1px #c1c1c1;
    box-shadow: 0 0 1px #c1c1c1 ;
    margin-bottom: 10px;
    padding-left: 0px;
    margin-right: 6px;
  }

  #mui-content .mui-media-body{
    color: #0094ff;
  }

  #mui-content .desc{
    height: 40px;
    background-color: rgba(0,0,0,0.1);
    margin-top: 10px;
    padding: 5px;
    text-align: left;
  }
  #mui-content .desc span{
    color: red;
    text-align: center;
    font-size:20px;
    display: block;
    line-height: 30px;
  }
  #mui-content a{
    padding-left: 0px;
    margin-left: 0px;
  }
  #mui-content a img{
    height:200px;
  }
  #mui-content .desc .right{
    position: absolute;
    right: 10px;
    bottom: 0px;
  }
  .mui-col-xs-6{
    width: 48%;
  }
  #mui-content .desc .left{
    position: absolute;
    left: 10px;
    bottom: 0px;
  }
</style>
